Most computer graphics images are computed all at once, so that the rendering program takes care of all computations relating to the overlap and transparency of objects within the image. There are several applications, however, where objects within or layers of an image are rendered separately. In such a case, the compositing techniques used for combining the objects or layers into a single image are relied upon for the anti-aliased accumulation of a full image in which the transparency of foreground layer objects with respect to a background layer is properly represented.
Standard digital RGBA images are defined at the pixel level by four values which define the red, green, and blue color components of the pixel, along with an alpha value which is a mixing factor indicating the amount of coverage or transparency of the pixel when composited with, e.g., overlaid on, a background image. For example, an alpha value for a pixel of zero may indicate no coverage or complete transparency, i.e., the pixel is clear, and thus would not in any way obscure a background layer pixel when composited therewith. An alpha value of one may mean full coverage or a completely opaque pixel, i.e., the pixel would completely cover the corresponding pixel of a background layer composited with the image. Fractional alpha values correspond to partial coverage by or transparency of the pixel when composited with a background layer image.
When compositing computer graphics images of objects or image layers which overlap, standard equations are employed to combine the color elements of corresponding overlapping pixels in appropriate amounts defined by the alpha values of the pixels (e.g., the alpha value of the foreground layer pixel). This conventional color combining procedure works well in many cases. However, for certain foreground layer objects, particularly semi-transparent objects, to be overlaid on a colored background layer, such a compositing procedure employing a formulaic averaging of color contributions made by the foreground layer object and background layer image will not result in the desired composited image if the foreground layer is rendered in a conventional manner. For example, it may be desired to composite a semi-transparent foreground layer object, such as a graphical representation of a white snowflake, over a colored background layer. If the semi-transparent foreground layer object (the snowflake) is rendered in RGBA in a conventional manner, the compositing of the foreground layer object (the snowflake) and background layer in a conventional manner involving an averaging of the color contributions made by the foreground and background layer objects may result in an off-colored object (e.g., a gray snowflake) superimposed on a background layer, rather than the desired semi-transparent object (white snowflake) overlaid on the background layer. (A semi-transparent white snowflake over a colored background would be the resulting image if the entire image, foreground and background layers, were rendered at the same time.) Similar color artifacts can occur at the edges of opaque foreground layer image objects rendered in a conventional manner and overlaid on a background layer image using conventional compositing techniques.
What is desired, therefore, is a relatively simple method of creating a digital image that is composed of two or more image layers and in which the resulting composition will appear the same as if the scene layers were rendered as a single scene all at the same time. Preferably, such a method permits the creation of image layers which can be rendered separately and stored to be composited together at a later time, possibly with additional material added between the rendered image layers.